﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<FinancialManagement.Models.BudgetApplyTable>" %>
<% using (Html.BeginForm())
   { %>
<div>
    <fieldset>
        <legend>
            <%=ViewBag.WindowTitle %></legend>
        <%:Html.HiddenFor(m=>m.ApplyID) %>
        <%: Html.HiddenFor(m => m.ApplyDepartment)%>
        <%: Html.HiddenFor(m => m.ApplyDepartmentName)%>
        <%: Html.HiddenFor(m=>m.Annual) %>
        <%:Html.HiddenFor(m=>m.RevenueType) %>
        <div class="editor-label">
            <%: Html.LabelFor(m => m.RevenueTypeName)%>
        </div>
        <div class="editor-field">
            <%= Html.Telerik().ComboBoxFor(m=>m.RevenueTypeCode)
            .DataBinding(binding => binding.Ajax().Select("LoadingRevenueTypes", "ComboBox"))
            .Filterable(filtering => { 
                filtering.FilterMode(AutoCompleteFilterMode.StartsWith); 
            })
            .HighlightFirstMatch(true)         
            .HtmlAttributes(new { style = string.Format("width:{0}px", 200) })    
            %>
            <%: Html.ValidationMessageFor(m => m.RevenueTypeName)%>
        </div>
        <div class="editor-label">
            <%: Html.LabelFor(m => m.ChargeProjectName) %>
        </div>
        <div class="editor-field">
            <%: Html.TextBoxFor(m => m.ChargeProjectName)%>
            <%: Html.ValidationMessageFor(m => m.ChargeProjectName)%>
        </div>
        <div class="editor-label">
            <%: Html.LabelFor(m => m.CalculateUnitName)%>
        </div>
        <div class="editor-field">
            <%= Html.Telerik().ComboBox()
                           .Name("CalculateUnitCode")
            .DataBinding(binding => binding.Ajax().Select("LoadingCalculateUnits", "ComboBox"))
            .Filterable(filtering => { 
                filtering.FilterMode(AutoCompleteFilterMode.StartsWith); 
            })
            .HighlightFirstMatch(true)         
            .HtmlAttributes(new { style = string.Format("width:{0}px", 200) })    
            %>
            <%: Html.ValidationMessageFor(m => m.CalculateUnitName)%>
        </div>
        <div class="editor-label">
            <%: Html.LabelFor(m => m.ChargeStandard) %>
        </div>
        <div class="editor-field">
            <%: Html.TextBoxFor(m => m.ChargeStandard)%>
            <%: Html.ValidationMessageFor(m => m.ChargeStandard)%>
        </div>
        <div class="editor-label">
            <%: Html.LabelFor(m => m.ChargeScopeName)%>
        </div>
        <div class="editor-field">
            <%= Html.Telerik().ComboBox()
                           .Name("ChargeScopeCode")
            .DataBinding(binding => binding.Ajax().Select("LoadingChargeScopes", "ComboBox"))
            .Filterable(filtering => { 
                filtering.FilterMode(AutoCompleteFilterMode.StartsWith); 
            })
            .HighlightFirstMatch(true)         
            .HtmlAttributes(new { style = string.Format("width:{0}px", 200) })    
            %>
            <%: Html.ValidationMessageFor(m => m.ChargeScopeName)%>
        </div>
        <%if ("Budget".Equals(ViewData["TYPE"]))
          { %>
        <div class="editor-label">
            <%: Html.LabelFor(m => m.BudgetTotalRreven)%>
        </div>
        <div class="editor-field">
            <%: Html.TextBoxFor(m => m.BudgetTotalRreven)%>
            <%: Html.ValidationMessageFor(m => m.BudgetTotalRreven)%>
        </div>
        <%}
          else
          {%>
        <div class="editor-label">
            <%: Html.LabelFor(m => m.ActualTotalRreven)%>
        </div>
        <div class="editor-field">
            <%: Html.TextBoxFor(m => m.ActualTotalRreven)%>
            <%: Html.ValidationMessageFor(m => m.ActualTotalRreven)%>
        </div>
        <%} %>
        <div class="editor-label">
            <%: Html.LabelFor(m => m.BudgetAccding) %><%:ViewBag.StrLen%>
        </div>
        <div class="editor-field">
            <%: Html.TextAreaFor(m => m.BudgetAccding)%>
            <%: Html.ValidationMessageFor(m => m.BudgetAccding)%>
        </div>
        <div class="editor-label">
            <%: Html.LabelFor(m => m.Notes) %>
        </div>
        <div class="editor-field">
            <%: Html.TextAreaFor(m => m.Notes)%>
            <%: Html.ValidationMessageFor(m => m.Notes)%>
        </div>
        <div class="editor-label">
            <%: Html.LabelFor(m => m.Illustration) %>
        </div>
        <div class="editor-field">
            <%= Html.Telerik().Upload()            
        .Name("attachments")            
        .Multiple(false)            
        .Async(async => async
        .Save("Save", "Upload")
        .Remove("Remove", "Upload")
            .AutoUpload(true)
            )   
            %>
            <p class="note">
                文件必须小于: 10 MB
            </p>
        </div>
        <p>
            <input type="button" value="更 新" onclick="saveContent()" />
            <input type="button" value="取 消" onclick="closeWindow()" />
        </p>
    </fieldset>
</div>
<% } %>
